<template>
  <div class="address-box">
    <!-- <search :searchInfo="searchInfo"
            @searchFn="searchFn"
            @search="searchAddress"></search> -->
    <address-lists :addressInfo="addressInfo"
                   @selectAddress="selectAddress"></address-lists>
    <!-- <edit-address :editInfo="editInfo"></edit-address> -->
  </div>
</template>

<script>
import Vue from 'vue'
import AddressLists from '@/components/AddressLists/index'
// import EditAddress from '@/components/EditAddress/index'
// import Search from '@/components/Search/index'
export default Vue.extend({
  name: 'index',
  components: {
    AddressLists
    // EditAddress,
    // Search
  },
  data() {
    return {
      searchInfo: {
        placeholder: '请输入姓名或者手机号'
      },
      addressInfo: {
        showBackButton: 0,
        headerTitle: '收货地址',
        searchInfoText: '',
        addLists: [
          {
            address_id: '11',
            is_default_address: 1,
            name: '夏夏',
            mobile: '15112121212',
            province: '浙江省',
            city: '杭州市',
            area: '西湖区',
            town: 'xh街道',
            address: '22号'
          },
          {
            address_id: '12',
            is_default_address: 0,
            name: '夏夏2',
            mobile: '15112121212',
            province: '浙江省',
            city: '杭州市',
            area: '西湖区',
            town: 'xh街道',
            address: '22号'
          }
        ]
      }
    }
  },
  methods: {
    // searchFn() { },
    // searchAddress(key) {
    //   this.addressInfo.searchInfoText = key
    // },
    // 选择地址
    selectAddress(item) {
      this.$emit('selectAddress', item)
    }
  }
})
</script>

<style lang="scss">
.aaa {
  color: #fff;
}
.address-box {
  height: 100vh;
  overflow-y: auto;
}
</style>